package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @version 1.0
 * @Author: xxf
 * @CreateDate: 2020/9/27 16:52
 */
public class Orders implements Serializable {

    private static final long serialVersionUID = -8931019039465501610L;

    private String oid;
    private Integer uid;
    private Integer aid;
    private Address address;
    private BigDecimal ocount;// 订单金额
    private Date otime;
    private Integer ostate = 0;// 订单状态  0未付款  1已付款，待发货  2已发货，待收货  3订单完成
    private List<Item> items;

    @Override
    public String toString() {
        return "Orders{" +
                "oid='" + oid + '\'' +
                ", uid=" + uid +
                ", aid=" + aid +
                ", address=" + address +
                ", ocount=" + ocount +
                ", otime=" + otime +
                ", ostate=" + ostate +
                ", items=" + items +
                '}';
    }

    public List<Item> getItems() {
        return items;
    }

    public void setItems(List<Item> items) {
        this.items = items;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    /**
     * 有地址对象
     * @param oid
     * @param uid
     * @param aid
     * @param address
     * @param ocount
     * @param otime
     */
    public Orders(String oid, Integer uid, Integer aid, Address address, BigDecimal ocount, Date otime) {
        this.oid = oid;
        this.uid = uid;
        this.aid = aid;
        this.address = address;
        this.ocount = ocount;
        this.otime = otime;
    }

    /**
     * 没有地址对象赋值
     * @param oid
     * @param uid
     * @param aid
     * @param ocount
     * @param otime
     */
    public Orders(String oid, Integer uid, Integer aid, BigDecimal ocount, Date otime) {
        this.oid = oid;
        this.uid = uid;
        this.aid = aid;
        this.ocount = ocount;
        this.otime = otime;
    }

    public Orders() {
    }

    public Integer getAid() {
        return aid;
    }

    public void setAid(Integer aid) {
        this.aid = aid;
    }

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public BigDecimal getOcount() {
        return ocount;
    }

    public void setOcount(BigDecimal ocount) {
        this.ocount = ocount;
    }

    public Date getOtime() {
        return otime;
    }

    public void setOtime(Date otime) {
        this.otime = otime;
    }

    public Integer getOstate() {
        return ostate;
    }

    public void setOstate(Integer ostate) {
        this.ostate = ostate;
    }
}
